package com.popo.android.widget;


import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;

public class MyDrawView extends ViewGroup {
	
	View tv = null;
	
	Paint paint =null;
	private Path firstLayerPath;
	private float x;
	private float y;
	private float x1;
	private float y1;
	private float x2;
	private float y2;
	private float x3;
	private float y3;
	public MyDrawView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		// TODO Auto-generated constructor stub
		System.out.println("MyDrawView");
//		LayoutInflater layoutInflater = LayoutInflater.from(context);
//		tv=layoutInflater.inflate(R.layout.linearlayout, null);
//		firstLayerPath = new Path();
//		
//		x=20;
//		y=20;
//		
//		x1=20;
//		y1=120;
//		
//		x2=120;
//		y2=120;
//		
//		x3=120;
//		
//		y3=20;
	}

	public MyDrawView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
		// TODO Auto-generated constructor stub
		// this
	}

	public MyDrawView(Context context) {
		this(context, null);
		// TODO Auto-generated constructor stub
		
	}
	
	
	@Override
	protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
		// TODO Auto-generated method stub
		
		return super.drawChild(canvas, child, drawingTime);
	}
	


	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
		// TODO Auto-generated method stub
		
		int childCount = getChildCount();
		System.out.println("onLayout:"+childCount+",l="+l+",t="+t+",r="+r+",b="+b);
		for(int i=0;i<childCount;i++){
			View v=getChildAt(i);
			v.layout(l, t, r, b);
		}

	}

	
	
}
